<%--
  Created by IntelliJ IDEA.
  User: ZhuChunXiao
  Date: 2017/5/22
  Time: 15:39
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
  String path = request.getContextPath();
  String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<form id="form_personnelreward_input" class="panel-body form-horizontal form-padding">
  <input type="hidden" name="keyId" id="keyId" value="${personnelReward.id}" />
  <input type="hidden" name="parentId" id="parentId" value="${personnelReward.personnelInfo.id}" />

  <div class="form-group">
    <label class="col-md-2 control-label">奖惩类型<i class="fa fa-asterisk txt-color-red"></i>
    </label>
    <div class="col-md-6">
      <div class="radio">
        <!-- Inline radio buttons -->
        <input disabled type="radio" name="type" id="type1Selected" class="magic-radio" value="1"
        <c:if test="${personnelReward.type eq 1}"> checked="checked"</c:if> >
        <label for="type1Selected">奖励</label>

        <input disabled type="radio" name="type" id="type2Selected" class="magic-radio" value="2"
        <c:if test="${personnelReward.type eq 2}"> checked="checked"</c:if> >
        <label for="type2Selected">惩罚</label>

      </div>
    </div>
  </div>

  <div class="form-group" id="tempWidth1">
    <label class="col-md-2 control-label">奖惩名称<i class="fa fa-asterisk txt-color-red"></i></label>
    <div class="col-md-6">
      <input disabled type="text" id="name" name="name" class="form-control" placeholder="请输入奖惩名称" value="${personnelReward.name}">
    </div>
  </div>

  <div class="form-group div-Hidden">
    <label class="col-md-2 control-label">奖惩时间<i class="fa fa-asterisk txt-color-red"></i></label>
    <div class="col-md-6">
      <div class="input-group date">
        <input disabled type="text" class="form-control" id="date" name="date" placeholder="请选择奖惩日期"
               value=<fmt:formatDate pattern="yyyy-MM-dd" value="${personnelReward.date}" /> >
        <span class="input-group-addon"><i class="ti-calendar"></i></span>
      </div>
    </div>
  </div>

  <div class="form-group">
    <label class="col-md-2 control-label">相关附件<i class="fa fa-asterisk txt-color-red"></i></label>
    <div class="col-md-6">
      <input name="hiddenFiles" id="hiddenFilesAttachment" type="hidden" value="${personnelReward.fileAttachment}">
    </div>
  </div>


  <div class="form-group">
    <label class="col-md-2 control-label">提交人</label>
    <div class="col-md-2">
      <p class="form-control-static">${personnelReward.creater.name}</p>
    </div>
    <label class="col-md-2 control-label">提交日期</label>
    <div class="col-md-2">
      <p class="form-control-static"><fmt:formatDate pattern="yyyy-MM-dd" value="${personnelReward.createTime}" /></p>
    </div>
  </div>
</form>
<!--===================================================-->
<!-- END BASIC FORM ELEMENTS -->

<div class="panel-footer">
  <a class="btn btn-default" id="apply-re-common7" href="javascript:void(0)">
    <i class="fa fa-lg fa-mail-reply"></i> 返回视图
  </a>
  <c:if test="${personnelReward.numStatus==0 && user.id==personnelReward.creater.id}">
    <a class="btn btn-warning" key="ajax_personnelreward_edit" href="javascript:void(0);"><i class="fa fa-lg fa-edit"></i> 编辑表单 </a>
  </c:if>
</div>

<script>

  // 附件显示
  readLoad({
    objId:"hiddenFilesAttachment",
    entityName:"fileAttachment",
    sourceId:"hiddenFilesAttachment"
  });

  //返回视图
  $("#apply-re-common7").click(function(){
    var parentId=$("#form_personnelinfo_input #keyId").val();
    var tableWidth=$("#tempWidth1").width();
    loadURL("<%=path%>/activiti/personnelreward/toList?parentId="+parentId+"&tableWidth="+tableWidth,$('#bsc-tab-7'));
  });

  //编辑
  $("a[key='ajax_personnelreward_edit']").unbind("click").bind("click",function(){
    __confirm_dialog("提示：","确定要编辑基本信息吗？",
            function () {
              // 加载编辑页面
              loadURL("<%=path%>/activiti/personnelreward/edit/"+$("#form_personnelreward_input #keyId").val()+"?parentId="+$("#form_personnelreward_input #parentId").val(),$('#bsc-tab-7'));
            }
    )
  });

</script>